Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic on short RC4Cipher.XORKeyStream output #60

Merged
merged 2 commits into from
Sep 27, 2024
Merged

Panic on short RC4Cipher.XORKeyStream output #60

merged 2 commits into from
Sep 27, 2024

Conversation

qmuntal
Copy link
Member

@qmuntal qmuntal commented Sep 26, 2024

This PR fixes a small behavior difference with upstream RC4: RC4Cipher.XORKeyStream panics if the output buffer is smaller than the input buffer, while CNG doesn't complain and just does nothing. Also added an extensive test suite so we are fully compatible with upstream RC4.

@qmuntal
Copy link
Member Author

qmuntal commented Sep 26, 2024

Depends on #61.

cng/rc4.go Outdated Show resolved Hide resolved
Co-authored-by: Davis Goodin <[email protected]>
@qmuntal qmuntal merged commit fde8545 into main Sep 27, 2024
17 checks passed
@qmuntal qmuntal deleted the rc4panic branch September 27, 2024 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants